<template>
  <div class="main">
    <van-row class="van_row">
      <van-nav-bar title="忘记密码" fixed />
    </van-row>
    <van-form @submit="onSubmit">
        <van-field
        v-model="user"
        name="用户名"
        label="用户名:"
        placeholder="输入内容"
        :rules="[{ required: true, message: '请填写用户名' }]"
      />
      <van-field
        v-model="username"
        name="手机号"
        label="手机号:"
        placeholder="输入内容"
        :rules="[{ required: true, message: '请填写手机号' }]"
      />
        <van-field
        v-model="sms"
        center
        clearable
        label="短信验证码："
        placeholder="请输入短信验证码"
      >
        <template #button>
          <van-button size="small" type="primary" @click="fasong">发送验证码</van-button>
        </template>
      </van-field>
      <van-field
        v-model="password"
        type="password"
        name="设置密码"
        label="设置密码："
        placeholder="设置密码"
        :rules="[{ required: true, message: '请输入内容' }]"
      />
         <van-field
        v-model="password1"
        type="password"
        name="再次输入"
        label="再次输入："
        placeholder="再次输入"
        :rules="[{ required: true, message: '请输入内容' }]"
      />
      <div style="margin: 16px">
        <van-button round block type="info" class="van-botton_from" native-type="submit"
          >提交</van-button
        >
      </div>
    </van-form>
  </div>
</template>
<script>
export default {
  name: "",
  data() {
    return {
        user:"",
      username: "",
      password: "",
      password1:"",
      sms:"",
    };
  },
  methods: {
      fasong(){
        //   Notify({ type: 'primary', message: '通知内容' });
      },
    onSubmit(values) {
      console.log("submit", values);
      this.$notify({type:"success",message:"三秒钟头跳转到登录页面登录！"})
      setTimeout(function(){
          this.$router.push({path:'/login'})
      },3000)  
    },
  },
};
</script>
<style scoped lang='less'>
.main {
  .van_row {
    position: relative;
    .van-nav-bar {
      color: rgba(42, 131, 78, 1);
      background-color: rgba(239, 239, 239, 1);
      font-size: 16px;

      text-align: center;
      /deep/div.van-nav-bar__title {
        font-size: 20px;
        color: rgba(42, 131, 78, 1);
      }
    }
    .van-nav-bar_after {
      position: fixed;
      width: 77px;
      height: 29px;
      border-radius: 50px;
      border: 1px solid silver;
      line-height: 29px;

      text-align: center;
      font-size: 16px;
      z-index: 13;
      top: 8px;
      right: 10px;
    }
  }
  .van-form {
    margin-top: 95px;
  .van-field{
      margin: 20px 0;
  }
  .van-botton_from{
      margin: 50px 0;
  }
  .van-button--info{
      background-color: green;
      border: none;
  }
  }
}
</style>